]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
panelMenu: Consider vertical margins when computing max-height
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 13 Feb 2015 19:52:11 +0000 (20:52 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 15 Feb 2015 09:23:39 +0000 (10:23 +0100)
When opening a panel menu, we set it's max-height to the available
work-area height to keep menus with scrollable content from growing
outside the monitor. However a menu that extends all the way down
to the bottom edge does not look great either, so also take margins
into account here.

https://bugzilla.gnome.org/show_bug.cgi?id=744498

data/theme/gnome-shell.css
js/ui/panelMenu.js

index 09b692ac5f9f96c288718ed112f34bc601ea7d08..072f18bcfed60ed1c801e72bda7c22e13f37365e 100644 (file)
@@ -715,6 +715,7 @@ StScrollBar StButton#vhandle:active {
 
 .panel-menu {
     -boxpointer-gap: 4px;
+    margin-bottom: 1.75em;
 }
 
 .panel-status-indicators-box,
index 29acd29b480f2b7a9fb9bb79aa18af57fbaebf42..092ca233a6b3d5e50d21fd497ddc239476df3a35 100644 (file)
@@ -173,7 +173,8 @@ const Button = new Lang.Class({
         // menu is higher then the screen; it's useful if part of the menu is
         // scrollable so the minimum height is smaller than the natural height
         let workArea = Main.layoutManager.getWorkAreaForMonitor(Main.layoutManager.primaryIndex);
-        this.menu.actor.style = ('max-height: ' + Math.round(workArea.height) + 'px;');
+        let verticalMargins = this.menu.actor.margin_top + this.menu.actor.margin_bottom;
+        this.menu.actor.style = ('max-height: ' + Math.round(workArea.height - verticalMargins) + 'px;');
     },
 
     destroy: function() {